package exception;

import javax.imageio.IIOException;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("开始了");
        FileOutputStream de=null;
        try{
            de=new FileOutputStream("./a/b/gg.txt");
            de.write(1);
        }catch(IIOException E){
            System.out.println("异常处理");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally{
            try {
                de.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        System.out.println("结束");
    }
}
